﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace seejee_Backendium.Core.Models
{
    public class User
    {
        [Key]
        public int iCusID { get; set; }
        public string cCusName { get; set; }
        public string cCusPassword { get; set; }

        public string Salt { get; set; }
        //public string cCusRealName { get; set; }
        //权限
        public int iCusPermissions { get; set; }


        public string cCusUserKey { get; set; }
        [NotMapped]
        public string cCusLicenses { get; set; }
        //创建时间
        public DateTime dCusCreateTime { get; set; }
        [NotMapped]
        public DateOnly dCusExpiryDate { get; set; }
        // 新增：只读属性，自动判断角色
        public string RoleName => iCusPermissions == 1 ? "客户" : iCusPermissions == 0 ? "管理员" : "未知";

    }
}
